#ifndef _HDCRYPT_H
#define _HDCRYPT_H

#ifdef __cplusplus
extern "C" {
#endif

typedef unsigned char uint8_t;

#define HDCRYPT_SUCCESS			0
#define HDCRYPT_COMM_FAIL		-1
#define HDCRYPT_TIMEOUT			-2
#define HDCRYPT_PARAM_ERR		-3
#define HDCRYPT_OTHER_FAIL	-4
#define HDCRYPT_CHECK_KEY_FAIL	-5

#define HDCRYPT_SERIAL_NO_LEN        (9)       
#define HDCRYPT_KEY_SIZE			(32)

#define HDCRYPT_KEY_ID1		1
#define HDCRYPT_KEY_ID2		2

int hdcrypt_init(void);
int hdcrypt_release(void);
int hdcrypt_get_serial_no(uint8_t serial_no[HDCRYPT_SERIAL_NO_LEN]);
int hdcrypt_get_random_data(uint8_t randnum[HDCRYPT_KEY_SIZE]);
int hdcrypt_write_key(int key_id,uint8_t key[HDCRYPT_KEY_SIZE]);
int hdcrypt_check_key(int key_id,uint8_t key[HDCRYPT_KEY_SIZE]);

#ifdef __cplusplus
}
#endif
#endif
